{include file="common/meta"}

<body>
<div class="x-body" id="adminEdit">
    <form class="layui-form" id="form_data">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="layui-form-item">
            <label for="username" class="layui-form-label">
                账号
            </label>
            <div class="layui-input-inline">
                <input type="text" id="username" name="username" readonly value="{$data.username}"
                       autocomplete="off" class="layui-input">
            </div>

        </div>

        <div class="layui-form-item">
            <label for="username" class="layui-form-label">
                昵称
            </label>
            <div class="layui-input-inline">
                <input type="text" id="nickname" name="nickname" value="{$data.nickname}"
                       autocomplete="off" class="layui-input">
            </div>

        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                手机号
            </label>
            <div class="layui-input-inline">
                <input type="text" name="mobile_tel" value="{$data.mobile_tel}"
                       autocomplete="off" class="layui-input">
            </div>

        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                邮箱
            </label>
            <div class="layui-input-inline">
                <input type="email" name="email" value="{$data.email}"
                       autocomplete="off" class="layui-input">
            </div>

        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-inline">
                <select  name="groupid">
                    {volist name="bumen" id="vo"}
                    <option  value="{$vo.id}" {if condition="$data.groupid==$vo.id"}selected="selected"{/if}>{$vo.title}</option>
                    {/volist}
                </select>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-inline">
                <input type="radio" name="sex" value=0 title="男" {if condition="$data.sex==0"}checked{/if}>
                <input type="radio" name="sex" value=1 title="女" {if condition="$data.sex==1"}checked{/if}>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">入职时间</label>
            <div class="layui-input-inline">
                <input type="text" name="workdate" id="workdate1"  placeholder="入职时间" autocomplete="off"
                       class="layui-input laydate1" value="{$data.workdate}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">离职时间</label>
            <div class="layui-input-inline">
                <input type="text" id="quitdate1" name="quitdate" placeholder="离职时间" autocomplete="off"
                       class="layui-input laydate2" value="{$data.quitdate}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-inline">
                <input type="number" name="id_card" placeholder="身份证号"
                       autocomplete="off" class="layui-input" value="{$data.id_card}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">工资卡开户行</label>
            <div class="layui-input-inline">
                <input type="text" name="bankname"  placeholder="工资卡开户行"
                       autocomplete="off" class="layui-input" value="{$data.bankname}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">工资卡账号</label>
            <div class="layui-input-inline">
                <input type="number" name="banknum"  placeholder="工资卡账号"
                       autocomplete="off" class="layui-input" value="{$data.banknum}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">职位</label>
            <div class="layui-input-inline">
                <input type="text" name="ranking"  placeholder="职位"
                       autocomplete="off" class="layui-input" value="{$data.ranking}">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="button" id="button_edit">立即提交</button>
            </div>
        </div>


    </form>
</div>
<script>
    // var id = ;
    // layui.use(['form', 'layer','laydate'], function () {
    //     $ = layui.jquery;
    //     var laydate = layui.laydate;
    //     new Vue({
    //         el: '#adminEdit',
    //         mounted: function () {
    //             this.getAdminData();
    //             this.getGroupCouPon();
    //         },
    //         data: {
    //             username: '',
    //             nickname: '',
    //             groupnamee:[],
    //             sex: 0,
    //             workdate: '',
    //             quitdate: '',
    //             id_card: 0,
    //             bankname: '',
    //             banknum: 0,
    //             ranking: '',
    //             mobile_tel : 0,
    //             email:'',
    //             type2:0,
    //         },
    //
    //         watch:{
    //             workdate:function () {
    //                 this.laydateTime();
    //             }
    //         },
    //         methods: {
    //             getAdminData: function () {
    //                 var _this = this;
    //                 $.get('{:url("getAdminData")}',{id:id}, function (result) {
    //                     console.log(result);
    //                     _this.username = result.username;
    //                     _this.nickname = result.nickname;
    //                     _this.email = result.email;
    //                     _this.mobile_tel = result.mobile_tel;
    //                     _this.sex = result.sex;
    //                 })
    //             },
    //             laydateTime:function() {
    //                 laydate.render({
    //                     elem: '#test1' //指定元素
    //                 });
    //             },
    //             getGroupCouPon: function () {
    //                 var _this = this;
    //                 $.post('{:url("groupData")}',function (res) {
    //
    //                     _this.$set(_this,'groupnamee',res);
    //                     console.log(_this.groupnamee);
    //                 })
    //             }
    //
    //
    //         }
    //     })
    //
    // });

    laydate.render({
        elem: '#workdate1' //指定元素
    });
    laydate.render({
        elem: '#quitdate1' //指定元素
    });
    $('#button_edit').click(function () {
        $.ajax({
            url:'{:url("editSave")}',
            type:'post',
            dataType:'json',
            data:$('#form_data').serializeArray(),
            success:function (res) {
                layer.alert(res.msg,function () {
                    x_admin_close();
                    x_admin_father_reload();
                },1000)
            }

        })
    })
</script>
</body>

</html>